import { isObj } from './isObj'
import { isArr } from './isArr'
import { isFn } from './isFn'
import { has } from './has'
// 4767
/**
 * 检查值是否是用 Object 构造函数创建的对象
 * dependencies isObj isArr isFn has
 * @param {} val
 * @returns 
 */
export function isPlainObj (val) {
  if (!isObj(val)) return false;
  var ctor = val.constructor;
  if (!isFn(ctor)) return false;
  if (!has(ctor.prototype, 'isPrototypeOf')) return false;
  return !isArr(val) && !isFn(val);
}